#import <UIKit/UIKit.h>
#import <sqlite3.h>
#import "User.h"
#import "Tweet.h"

@class Statement;


@interface Status : Tweet
{
    NSString*       source;
    BOOL            favorited;
    BOOL            truncated;
    sqlite_int64    inReplyToStatusId;
    int             inReplyToUserId;
    NSString*       inReplyToScreenName;
    
    sqlite_int64    ownerUserId;
	
	sqlite_int64	originStatusId;
    
    NSString* originPicture;
    NSString* smallPicture;
    NSString* middlePicture;
    CGSize    smallPictureSize;
    
    NSInteger forwardCount;
    NSInteger remarkCount;
    
    Status* originStatus;
}

@property (getter=tweetId, setter=setTweetId:) sqlite_int64  statusId;
//@property (nonatomic, retain) User*         user;
@property (nonatomic, retain) NSString*     source;
@property (nonatomic, assign) BOOL          favorited;
@property (nonatomic, assign) BOOL          truncated;
@property (nonatomic, assign) sqlite_int64  inReplyToStatusId;
@property (nonatomic, assign) int           inReplyToUserId;
@property (nonatomic, retain) NSString*     inReplyToScreenName;
@property (nonatomic, assign) sqlite_int64 originStatusId;
@property (nonatomic, assign) sqlite_int64 ownerUserId;
@property (nonatomic, assign) NSInteger forwardCount;
@property (nonatomic, assign) NSInteger remarkCount;

@property (nonatomic, retain) NSString* originPicture;
@property (nonatomic, retain) NSString* smallPicture;
@property (nonatomic, retain) NSString* middlePicture;
@property (nonatomic, assign) CGSize smallPictureSize;
@property (nonatomic, retain) Status* originStatus;

+ (Status*)statusWithId:(sqlite_int64)statusId;
+ (Status*)statusWithJsonDictionary:(NSDictionary*)dic type:(TweetType)type;
+ (Status*)statusWithSearchResult:(NSDictionary*)dic;
+ (Status*)statusWithStatement:(Statement*)statement type:(TweetType)type;
+ (BOOL)isExists:(sqlite_int64)statusId type:(TweetType)aType;

- (Status*)initWithJsonDictionary:(NSDictionary*)dic type:(TweetType)type;
- (Status*)initWithSearchResult:(NSDictionary*)dic;
- (void)updateAttribute;

- (void)insertDB;
- (void)insertDB:(NSString*)tablename;
- (void)insertDBIfFollowing;
- (void)deleteFromDB;
- (void)updateFavoriteState;
+ (void) updateStatus:(long long)statusId remarkCount:(NSInteger)remarkCount forwardCount:(NSInteger)forwardCount;

- (NSString*) sourceDescription;

@end
